package com.linewell.system.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
/**
 * 系统公告类 对应数据库表：SYS_NOTICE 
 */
@Entity
@Table(name="SYS_NOTICE")
@DynamicInsert(true)
@DynamicUpdate(true)
public class SysNotice implements Serializable{

	private static final long serialVersionUID = -3904324929204320992L;
	private Integer id;
	private String title;		//标题
	private String content;		//内容
//	private Integer depId;		//所属部门
	private SysDepartment sysDepartment;
	private Date pubTime;		//发布时间
	private Byte status;	//状态
	private Integer noticeType;	//公告类型
    private Integer pubUserId;	//发布人
	
	@Id
	@Column(name = "ID",nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)		//自增长
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(name = "TITLE")
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	
	@Column(name = "CONTENT")
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	@ManyToOne(targetEntity = SysDepartment.class)
	@JoinColumn(name = "DEP_ID")
	public SysDepartment getSysDepartment() {
		return sysDepartment;
	}

	public void setSysDepartment(SysDepartment sysDepartment) {
		this.sysDepartment = sysDepartment;
	}
	
	@Temporal(TemporalType.TIMESTAMP) 	//指定具体时间类型
	@Column(name = "PUB_TIME",columnDefinition = "timestamp default CURRENT_TIMESTAMP")
	public Date getPubTime() {
		return pubTime;
	}
	public void setPubTime(Date pubTime) {
		this.pubTime = pubTime;
	}
	
	@Column(name = "STATUS",columnDefinition = "tinyint default 9")
	public Byte getStatus() {
		return status;
	}
	public void setStatus(Byte status) {
		this.status = status;
	}
	
	@Column(name = "NOTICE_TYPE")
	public Integer getNoticeType() {
		return noticeType;
	}
	public void setNoticeType(Integer noticeType) {
		this.noticeType = noticeType;
	}
	@Column(name = "PUB_USER_ID")
	public Integer getPubUserId() {
		return pubUserId;
	}
	public void setPubUserId(Integer pubUserId) {
		this.pubUserId = pubUserId;
	}

}
